using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._GeostatisticalAnalystTools._Simulation
{
    /// <summary>
    /// <para>Gaussian Geostatistical Simulations</para>
    /// <para>Performs a conditional or unconditional geostatistical simulation based on a Simple Kriging model. The simulated rasters can be considered equally probable realizations of the kriging model.</para>
    /// <para>基于简单克里金模型执行条件或无条件地统计模拟。模拟的栅格可以被认为是克里金模型的同等可能性实现。</para>
    /// </summary>    
    [DisplayName("Gaussian Geostatistical Simulations")]
    public class GaussianGeostatisticalSimulations : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public GaussianGeostatisticalSimulations()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_geostat_layer">
        /// <para>Input geostatistical layer</para>
        /// <para>Input a geostatistical layer resulting from a Simple Kriging model.</para>
        /// <para>输入由 Simple Kriging 模型生成的地统计图层。</para>
        /// </param>
        /// <param name="_number_of_realizations">
        /// <para>Number of realizations</para>
        /// <para>The number of simulations to perform.</para>
        /// <para>要执行的模拟次数。</para>
        /// </param>
        /// <param name="_output_workspace">
        /// <para>Output workspace</para>
        /// <para>Stores all the simulation results. The workspace can be either a folder or a geodatabase.</para>
        /// <para>存储所有仿真结果。工作空间可以是文件夹，也可以是地理数据库。</para>
        /// </param>
        /// <param name="_output_simulation_prefix">
        /// <para>Output simulation prefix</para>
        /// <para>A one- to three-character alphanumeric prefix that is automatically added to the output dataset names.</para>
        /// <para>自动添加到输出数据集名称的一到三个字符的字母数字前缀。</para>
        /// </param>
        public GaussianGeostatisticalSimulations(object _in_geostat_layer, long _number_of_realizations, object _output_workspace, object _output_simulation_prefix)
        {
            this._in_geostat_layer = _in_geostat_layer;
            this._number_of_realizations = _number_of_realizations;
            this._output_workspace = _output_workspace;
            this._output_simulation_prefix = _output_simulation_prefix;
        }
        public override string ToolboxName => "Geostatistical Analyst Tools";

        public override string ToolName => "Gaussian Geostatistical Simulations";

        public override string CallName => "ga.GaussianGeostatisticalSimulations";

        public override List<string> AcceptEnvironments => ["cellSize", "extent", "geographicTransformations", "mask", "outputCoordinateSystem", "parallelProcessingFactor", "randomGenerator", "scratchWorkspace", "snapRaster", "workspace"];

        public override object[] ParameterInfo => [_in_geostat_layer, _number_of_realizations, _output_workspace, _output_simulation_prefix, _in_conditioning_features, _conditioning_field, _cell_size, _in_bounding_dataset, _save_simulated_rasters.GetGPValue(), _quantile, _threshold, _in_stats_polygons, _raster_stat_type, _conditioning_measurement_error_field, _out_workspace, _out_polygon_stat, _out_raster_simulation, _out_raster_stat, _out_convergence_value];

        /// <summary>
        /// <para>Input geostatistical layer</para>
        /// <para>Input a geostatistical layer resulting from a Simple Kriging model.</para>
        /// <para>输入由 Simple Kriging 模型生成的地统计图层。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input geostatistical layer")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_geostat_layer { get; set; }


        /// <summary>
        /// <para>Number of realizations</para>
        /// <para>The number of simulations to perform.</para>
        /// <para>要执行的模拟次数。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Number of realizations")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public long _number_of_realizations { get; set; }


        /// <summary>
        /// <para>Output workspace</para>
        /// <para>Stores all the simulation results. The workspace can be either a folder or a geodatabase.</para>
        /// <para>存储所有仿真结果。工作空间可以是文件夹，也可以是地理数据库。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output workspace")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _output_workspace { get; set; }


        /// <summary>
        /// <para>Output simulation prefix</para>
        /// <para>A one- to three-character alphanumeric prefix that is automatically added to the output dataset names.</para>
        /// <para>自动添加到输出数据集名称的一到三个字符的字母数字前缀。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output simulation prefix")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _output_simulation_prefix { get; set; }


        /// <summary>
        /// <para>Input conditioning features</para>
        /// <para>The features used to condition the realizations. If left blank, unconditional realizations are produced.</para>
        /// <para>用于调节实现的特征。如果留空，则产生无条件的实现。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input conditioning features")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _in_conditioning_features { get; set; } = null;


        /// <summary>
        /// <para>Conditioning field</para>
        /// <para>The field used to condition the realizations. If left blank, unconditional realizations are produced.</para>
        /// <para>用于调节实现的字段。如果留空，则产生无条件的实现。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Conditioning field")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _conditioning_field { get; set; } = null;


        /// <summary>
        /// <para>Output cell size</para>
        /// <para><xdoc>
        ///   <para>The cell size at which the output raster will be created.</para>
        ///   <para>This value can be explicitly set in the Environments by the Cell Size parameter.</para>
        ///   <para>If not set, it is the shorter of the width or the height of the extent of the input point features, in the input spatial reference, divided by 250.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>将创建输出栅格的像元大小。</para>
        ///   <para>此值可以通过像元大小参数在“环境”中显式设置。</para>
        ///   <para>如果未设置，则为输入空间参考中输入点要素范围的宽度或高度除以 250 的较短者。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output cell size")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _cell_size { get; set; } = null;


        /// <summary>
        /// <para>Input bounding features</para>
        /// <para>Limits the analysis to these features' bounding polygon. If point features are entered, then a convex hull polygon is automatically created. Realizations are then performed within that polygon. If bounding features are supplied, any features or rasters supplied in the Mask environment will be ignored.</para>
        /// <para>将分析限制为这些要素的边界面。如果输入了点要素，则会自动创建凸包面。然后在该多边形内执行实现。如果提供了边界要素，则将忽略蒙版环境中提供的任何要素或栅格。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input bounding features")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _in_bounding_dataset { get; set; } = null;


        /// <summary>
        /// <para>Save simulated rasters</para>
        /// <para><xdoc>
        ///   <para>Specifies whether or not the simulated rasters are saved to disk.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—Indicates that the simulated rasters will be saved to disk.</bullet_item><para/>
        ///     <bullet_item>Unchecked—Indicates that the simulated rasters will not be saved to disk.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定是否将模拟栅格保存到磁盘。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 - 表示模拟栅格将保存到磁盘。</bullet_item><para/>
        ///     <bullet_item>未选中 - 表示模拟栅格不会保存到磁盘。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Save simulated rasters")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _save_simulated_rasters_value _save_simulated_rasters { get; set; } = _save_simulated_rasters_value._false;

        public enum _save_simulated_rasters_value
        {
            /// <summary>
            /// <para>SAVE_SIMULATIONS</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("SAVE_SIMULATIONS")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>DO_NOT_SAVE_SIMULATIONS</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("DO_NOT_SAVE_SIMULATIONS")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Quantile</para>
        /// <para>The quantile value for which the output raster will be generated.</para>
        /// <para>将为其生成输出栅格的分位数值。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Quantile")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public double? _quantile { get; set; } = null;


        /// <summary>
        /// <para>Threshold</para>
        /// <para>The threshold value for which the output raster will be generated, as the percentage of the number of times the set threshold was exceeded, on a cell-by-cell basis.</para>
        /// <para>将生成输出栅格的阈值，以超出设置阈值的次数的百分比表示，以逐个像元为基础。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Threshold")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public double? _threshold { get; set; } = null;


        /// <summary>
        /// <para>Input statistical polygons</para>
        /// <para><xdoc>
        ///   <para>These polygons represent areas of interest for which summary statistics are calculated.</para>
        ///   <para>If statistical polygons are provided, the output polygon feature class will be saved in the Output workspace, and it will have the same name as the input polygons, preceded by the Output simulation prefix. For example, if the input statistical polygons were named myPolys and you entered aaa as the output prefix, then the output polygons will be named aaamyPolys, and will be saved in the specified output workspace.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>这些面表示要计算汇总统计的感兴趣区域。</para>
        ///   <para>如果提供了统计面，则输出面要素类将保存在输出工作空间中，并且该要素类的名称将与输入面同名，前面带有输出模拟前缀。例如，如果输入统计多边形名为 myPolys，并且您输入了 aaa 作为输出前缀，则输出多边形将命名为 aaamyPolys，并将保存在指定的输出工作空间中。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input statistical polygons")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _in_stats_polygons { get; set; } = null;


        /// <summary>
        /// <para>Raster statistics type</para>
        /// <para><xdoc>
        ///   <para>The simulated rasters are postprocessed on a cell-by-cell basis, and each selected statistics type is calculated and reported in an output raster.</para>
        ///   <bulletList>
        ///     <bullet_item>Minimum—Calculates the minimum (smallest value).</bullet_item><para/>
        ///     <bullet_item>Maximum—Calculates the maximum (largest value).</bullet_item><para/>
        ///     <bullet_item>Mean—Calculates the mean (average).</bullet_item><para/>
        ///     <bullet_item>Standard deviation—Calculates the standard deviation.</bullet_item><para/>
        ///     <bullet_item>First quartile—Calculates the 25th quantile.</bullet_item><para/>
        ///     <bullet_item>Median—Calculates the median.</bullet_item><para/>
        ///     <bullet_item>Third quartile—Calculates the 75th quantile.</bullet_item><para/>
        ///     <bullet_item>Quantile—Calculates a user-specified quantile (0 < Q < 1).</bullet_item><para/>
        ///     <bullet_item>Probability threshold—Calculates the percentage of the simulations where the cell value exceeds a user-specified threshold value.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>模拟栅格将逐个单元进行后处理，并在输出栅格中计算和报告每个选定的统计数据类型。</para>
        ///   <bulletList>
        ///     <bullet_item>最小值 （Minimum） - 计算最小值（最小值）。</bullet_item><para/>
        ///     <bullet_item>最大值 （Maximum） - 计算最大值（最大值）。</bullet_item><para/>
        ///     <bullet_item>均值 （Mean） - 计算均值（平均值）。</bullet_item><para/>
        ///     <bullet_item>标准差 （Standard deviation） - 计算标准差。</bullet_item><para/>
        ///     <bullet_item>第一个四分位数 - 计算第 25 个分位数。</bullet_item><para/>
        ///     <bullet_item>中位数 （Median） - 计算中位数。</bullet_item><para/>
        ///     <bullet_item>第三个四分位数 - 计算第 75 个分位数。</bullet_item><para/>
        /// <bullet_item>分位数 （Quantile） - 计算用户指定的分位数 （0 < Q < 1）。</bullet_item><para/>
        ///     <bullet_item>概率阈值 （Probability threshold） - 计算像元值超过用户指定阈值的模拟百分比。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Raster statistics type")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public List<object> _raster_stat_type { get; set; } = null;


        /// <summary>
        /// <para>Conditioning measurement error field</para>
        /// <para><xdoc>
        ///   <para>A field that specifies the measurement error for each input point in the conditioning features. For each conditioning feature, the value of this field should correspond to one standard deviation of the measured value of the feature. Use this field if the measurement error values are not the same at each sampling location.</para>
        ///   <para>A common source of nonconstant measurement error is when the data is measured with different devices. One device might be more precise than another, which means that it will have a smaller measurement error. For example, one thermometer rounds to the nearest degree and another thermometer rounds to the nearest tenth of a degree. The variability of measurements is often provided by the manufacturer of the measuring device, or it may be known from empirical practice.</para>
        ///   <para>Leave this parameter blank if there are no measurement error values or the measurement error values are unknown.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定调节要素中每个输入点的测量误差的字段。对于每个条件要素，此字段的值应对应于要素测量值的一个标准差。如果每个采样位置的测量误差值不同，请使用此字段。</para>
        ///   <para>非恒定测量误差的一个常见来源是使用不同的设备测量数据。一个设备可能比另一个设备更精确，这意味着它的测量误差更小。例如，一个温度计四舍五入到最接近的度数，另一个温度计四舍五入到最接近的十分之一度。测量的可变性通常由测量设备的制造商提供，或者可以从经验实践中知道。</para>
        ///   <para>如果没有测量误差值或测量误差值未知，则将此参数留空。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Conditioning measurement error field")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _conditioning_measurement_error_field { get; set; } = null;


        /// <summary>
        /// <para>Output workspace</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output workspace")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _out_workspace { get; set; }


        /// <summary>
        /// <para>Output statistical polygons</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output statistical polygons")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _out_polygon_stat { get; set; }


        /// <summary>
        /// <para>Output simulation rasters</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output simulation rasters")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public List<object> _out_raster_simulation { get; set; }


        /// <summary>
        /// <para>Output statistical rasters</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output statistical rasters")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public List<object> _out_raster_stat { get; set; }


        /// <summary>
        /// <para>Convergence</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Convergence")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public double _out_convergence_value { get; set; }


        public GaussianGeostatisticalSimulations SetEnv(object cellSize = null, object extent = null, object geographicTransformations = null, object mask = null, object outputCoordinateSystem = null, object parallelProcessingFactor = null, object randomGenerator = null, object scratchWorkspace = null, object snapRaster = null, object workspace = null)
        {
            base.SetEnv(cellSize: cellSize, extent: extent, geographicTransformations: geographicTransformations, mask: mask, outputCoordinateSystem: outputCoordinateSystem, parallelProcessingFactor: parallelProcessingFactor, randomGenerator: randomGenerator, scratchWorkspace: scratchWorkspace, snapRaster: snapRaster, workspace: workspace);
            return this;
        }

    }

}